<?php
if($_COOKIE['username']=='')
{
    header("location:login.php");
}
$dbh=new PDO('mysql:host=localhost;dbname=gaofei','root','root');
$sql="select * from zc";
$users=$dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC);
?>
<table border="1">
    <tr>
        <td>id</td>
        <td>名称</td>
        <td>邮箱</td>
        <td>状态</td>
        <td>操作</td>
    </tr>
    <?php
      foreach($users as $v)
      {
          if($v['status']==1)
          {
              $s="未激活";
          }
          else{
              $s="激活";
          }

          echo "<tr><td>{$v['id']}</td><td>{$v['username']}</td><td>{$v['email']}</td><td><a href='status.php?id={$v['id']}&status={$v['status']}'>$s</a></td><td><a href='updates.php?id={$v['id']}'>修改密码</a></td></tr>";
      }

    ?>
</table>
